package com.job.GaoYuXuan.Homework0709;

import java.util.Scanner;

/**
 * @author 盖
 * @version 1.0
 * @since 2022-07-10 14:00:01
 */
public class YanghuiTriangle {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.println("请输入打印的行数：");
        int row = input.nextInt();
        int[][] array = new int[row][row];
        for (int i = 0; i < row; i++){
            array[i][0] = 1;
        }
        for (int i = 1; i < row; i++){
            for (int j = 1; j <= i; j++){
                array[i][j] = array[i - 1][j - 1] + array[i - 1][j];
            }
        }
        for (int i = 0; i < row; i++){
            for (int j = 0; j <= i; j++){
                System.out.print(array[i][j] + "\t");
            }
            System.out.println("");
        }
    }
}